<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" 
           uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>我的商城</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath }/html/css/style.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/html/css/login.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/html/css/invest.css">
	<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
	</script>
	<style>
		.select {
				  width:auto; margin-top:12px; 
			      font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
			      font-size:11px; 
			      color:#999999;
			      line-height:25px;
			      letter-spacing:1px

			}
	</style>
</head>
<body>
  <div class="wrap" style="background-color:#f7f7f7;">
  
	<ul id="nav" style="position: absolute;left:71px;top:59px">
        <li><a href="${pageContext.request.contextPath }/user/toConsumeBase"><span>首页</span></a></li>
    </ul>
    <br/>
    <div class="main">
        <div class="withdraw">
            <h3 style="float:left">我的订单列表 <span></span> 
            </h3>
        </div>
        <div class="invest" style="clear:both;">
            <ul id="investTitle">
          <c:if test="${enhanceList!=null}"> 
          <c:forEach items="${enhanceList}" var="enhance">
                <li>
                    <p class="dkmc" style="font-size:25px"><label class="code"><a href="${pageContext.request.contextPath }/user/orderDetails?code=${enhance.myOrder.code}">${enhance.myOrder.code}</a></label></p>
                    <div class="investCont">
                        <div style="width: 160px">
                            <p class="lilv"><label class="status">${enhance.orderStatus.describe}</label></p>
                            <p class="investTit">订单状态</p>
                        </div>
                        <div  style="width: 160px">
                            <p class="lilv" style="color: #858585">${enhance.shippingAddress.name}</p>
                            <p class="investTit">收货人姓名</p>
                        </div>
                        <div  style="width: 160px">
                            <p class="lilv" style="color: #858585">${enhance.shippingAddress.phonenum}</p>
                            <p class="investTit">联系电话</p>
                        </div>
                        <div  style="width: 160px">
                            <p class="lilv" style="color: #858585;width:190px">${enhance.shippingAddress.province}${enhance.shippingAddress.city}${enhance.shippingAddress.address}(${enhance.shippingAddress.addressalias})</p>
                            <p class="investTit">收货地址</p>
                        </div>
                        <div style="float:right">
                        	<a class="recall" href="${pageContext.request.contextPath }/user/recallOrder?myOrderId=${enhance.myOrder.id}&myOrderStatus=${enhance.orderStatus.describe}"><button class="btn1">撤单</button></a>
							<a style="display: none;" class="pay" href="${pageContext.request.contextPath }/user/payOrder?myOrderId=${enhance.myOrder.id}"><button class="btn1">付款</button></a>
							<a style="display: none;" class="receive" href="${pageContext.request.contextPath }/user/receiveOrder?myOrderId=${enhance.myOrder.id}"><button class="btn1">收货</button></a>
                           
                        </div>
                    </div>
                </li>
             </c:forEach> 
             </c:if> 
            </ul>
        </div>
    </div><!--main-->
</div><!--wrap-->
	<c:if test="${outTime}">
			<script>
				(function()
				{
					alert("收货时间超过七天无法直接退货,如需退货请联系客服")
				})();
			</script>
		</c:if>
	<script>
		$(document).ready(function(){
			$.each($(".status"),function(index,content){
				if($(content).text()=="撤单")
				{
					$(".recall").eq(index).hide();
					return;
				}
				if($(content).text()=="未付款")
				{
					$(".pay").eq(index).show();
					return;
				}
				if($(content).text()=="待收货")
				{
					$(".receive").eq(index).show();
					return;
				}
			})
			
		})
	</script>
</body>
</html>
